/**
 * Created by changshuiwang on 2016/7/25.
 */
$(function(){
    $("#login-form").submit(function (){
        var data=$(this).serialize();
        $.ajax({
            type:"POST",
            data:data,
            url:"/site/login",
            dataType:"json",
            success:function(msg){
                if(msg.status=="success"){
                    window.location.href="/site/index";
                }else{
                    alert(msg.error);
                }
            }
        })
        return false;
    });
})
